package com.tiantianfresh.view.controller;

import com.tiantianfresh.model.pojo.AJAXResult;
import com.tiantianfresh.model.pojo.CommodityResult;
import com.tiantianfresh.view.service.ShopFullwidthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author FANGAO
 * @date 2021/12/8 - 下午 23:33
 */
@Controller
@RequestMapping("/shopfullwidth")
public class ShopFullwidthController {
    @Autowired
    private ShopFullwidthService shopFullwidthService;
    @ResponseBody
    @RequestMapping("/queryCommodity")
    public Object queryCommodity(){
        AJAXResult result = new AJAXResult();
        List<CommodityResult> commodityResult = shopFullwidthService.queryCommodity();
        if (commodityResult!=null){
            result.setSuccess(true);
            result.setData(commodityResult);
        }else{
            result.setSuccess(false);
        }
        return result;
    }

}
